/*
 * Copyright 2008 M-Way Solutions
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.mwaysolutions.ocm;

import javax.jcr.Item;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.Workspace;


/**
 *
 * @author <a href="mailto:m.zdila@mwaysolutions.com">Martin Ždila</a>
 */
public interface OcmProcessor {

	OcmTypeRegister getOcmTypeRegister();

	Object get(Node node) throws RepositoryException, OcmException;

	Item update(Session session, Object object) throws PathNotFoundException, RepositoryException, OcmException;

	Item saveOrUpdate(Session session, String targetNodePath, Object object) throws PathNotFoundException, RepositoryException, OcmException;

	Item save(Node parentNode, String name, Object object) throws RepositoryException, OcmException;

	Item saveOrUpdate(Node parentNode, String name, Object object) throws RepositoryException, OcmException;

	void saveOrUpdate(Node node, Object value) throws OcmException, RepositoryException;

	void registerType(Workspace workspace, Class<?> clazz, String name) throws RepositoryException;

	void reregisterType(Workspace workspace, Class<?> clazz, String name) throws RepositoryException;

	void registerType(Workspace workspace, Class<?>... clazz) throws RepositoryException;

	void reregisterType(Workspace workspace, Class<?>... clazz) throws RepositoryException;

}
